package com.ozo.boot.common.file.service;

import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
 * 文件服务接口
 *
 * @author qiangesoft
 * @date 2024-05-13
 */
public interface FileTemplate {

    /**
     * 创建分类
     *
     * @param catalog
     * @throws Exception
     */
    void createCatalog(String catalog) throws Exception;

    /**
     * 获取分类
     *
     * @return
     */
    List<String> listCatalogs() throws Exception;

    /**
     * 删除分类
     *
     * @param catalog
     * @throws Exception
     */
    void removeCatalog(String catalog) throws Exception;

    /**
     * 上传文件
     *
     * @param catalog
     * @param file
     * @return
     * @throws Exception
     */
    String uploadFile(String catalog, MultipartFile file) throws Exception;

    /**
     * 删除文件
     *
     * @param catalog
     * @param fileName
     * @throws Exception
     */
    void removeFile(String catalog, String fileName) throws Exception;

    /**
     * 删除文件
     *
     * @param catalog
     * @param fileNames
     * @throws Exception
     */
    void removeFiles(String catalog, List<String> fileNames) throws Exception;

}
